package com.xyb.config.exception;


import com.xyb.entity.StatusCode;

public class MyException extends RuntimeException {
    private int code;
    private String msg;

    /**
     * 自定义异常信息
     * @param msg
     */
    public MyException(String msg) {
        this.msg = msg;
    }

    /**
     * 已经存在的异常
     * @param statusCode
     */
    public MyException(StatusCode statusCode) {
        this.code = statusCode.getCode();
        this.msg = statusCode.getMsg();
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
